﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Sort</title>
    <link href="~/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/css/common.css" rel="stylesheet" type="text/css" />
    <script src="~/lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="~/lib/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js?v=@DateTime.Now.ToString("yyyyMMdd")"></script>
    <style type="text/css">
        .box {
            float: left;
            width: 220px;
            height: 80px;
            border: 1px solid #cccccc;
            margin: 3px 3px;
            border-radius: 5px;
            background-color: #eeeeee;
        }

        .boxInfo {
            float: left;
            padding: 10px 5px 0px 5px;
        }

        .content {
            border: solid 1px #e5e5e5;
            width: 98%;
            margin: 10px auto 10px auto;
            border-radius: 5px;
            box-shadow: 0px 0px 1px 1px #ccc;
            overflow: auto;
            overflow-x: hidden;
        }

        span {
            padding-right: 15px;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="box">
            <div class="boxInfo">名称：<span>带教</span>显示符号：<span style="color:Black">带教</span></div>
            <div class="boxInfo">
                原序号：<input type="text" id="oldSort" style="width:50px;" value="0" readonly="readonly" />
            </div>
            <input type="hidden" id="hdnId" class="hdnSort" value="1" />
        </div>
        <div class="box">
            <div class="boxInfo">名称1111：<span>带教</span>显示符号：<span style="color:Black">带教</span></div>
            <div class="boxInfo">
                原序号：<input type="text" id="oldSort" style="width:50px;" value="0" readonly="readonly" />
            </div>
            <input type="hidden" id="hdnId" class="hdnSort" value="1" />
        </div>
    </div>
    <div class="bottomPosition">
        <input id="btnSubmit" type="button" value="保存" class="l-button" style="background: skyblue;" onclick="saveSort()" />&nbsp;&nbsp;&nbsp;
        <input id="btnCancel" type="button" value="还原" class="l-button" onclick="window.location.reload();" />
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $(".content").height($(document).height() - 80);
        $('.box').ligerDrag({
            proxy: 'clone',
            receive: '.box',
            onDrop: function (receive, source, e) {
                if (!this.proxy) return;
                this.proxy.hide();
                var t = this.proxy.html();
                if (this.target.hasClass("box")) {
                    this.target.html($(receive).html());
                }
                $(receive).html(t);
            }
        });
    });

    function saveSort() {
        var areaPostSortList = [];
        $(".hdnSort").each(function (index) {
            var areaPostSort = { PostId: $(this).val(), Sort: index };
            areaPostSortList.push(areaPostSort);
        })
        return;
        $.ajax({
            url: "/Post/Save",
            type: "post",
            data: {

            },
            success: function (r) {
                var r = $.parseJSON(r);
                if (r.Result == 1) {
                    $.ligerDialog.success("保存成功");
                }
                else if (r.Result == 0) {
                    $.ligerDialog.error(r.Body);
                }
                else {
                    $.ligerDialog.error("程序错误");
                }
            }
        });
    }
</script>
